home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / stdlib / RCS / Mem_PrintInUse.c,v < prev    next >
Encoding:
Text File  |  1991-12-03  |  3.0 KB  |  136 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  sprited:1.2.1;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     89.06.15.22.36.49;  author douglis;  state Exp;
  11. branches 1.2.1.1;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     88.05.20.15.49.23;  author ouster;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19. 1.2.1.1
  20. date     91.12.02.20.37.49;  author kupfer;  state Exp;
  21. branches ;
  22. next     ;
  23.  
  24.  
  25. desc
  26. @@
  27.  
  28.  
  29. 1.2
  30. log
  31. @changed %12#x to %#12x.
  32. @
  33. text
  34. @/* 
  35.  * Mem_PrintInUse.c --
  36.  *
  37.  *    Source code for the "Mem_PrintInUse" library procedure.  See memInt.h
  38.  *    for overall information about how the allocator works..
  39.  *
  40.  * Copyright 1988 Regents of the University of California
  41.  * Permission to use, copy, modify, and distribute this
  42.  * software and its documentation for any purpose and without
  43.  * fee is hereby granted, provided that the above copyright
  44.  * notice appear in all copies.  The University of California
  45.  * makes no representations about the suitability of this
  46.  * software for any purpose.  It is provided "as is" without
  47.  * express or implied warranty.
  48.  */
  49.  
  50. #ifndef lint
  51. static char rcsid[] = "$Header: /sprite/src/lib/c/stdlib/RCS/Mem_PrintInUse.c,v 1.1 88/05/20 15:49:23 ouster Exp Locker: douglis $ SPRITE (Berkeley)";
  52. #endif not lint
  53.  
  54. #include "memInt.h"
  55.  
  56.  
  57. /*
  58.  * ----------------------------------------------------------------------------
  59.  *
  60.  * Mem_PrintInUse --
  61.  *
  62.  *      Uses a default procedure to print out the non-binned blocks in
  63.  *    the allocator that are still in use.  The original size and the
  64.  *    PC of the call to Mem_Alloc are printed.
  65.  *
  66.  * Results:
  67.  *      None.
  68.  *
  69.  * Side effects:
  70.  *      Stuff gets printed (?) by passing it to memPrintProc.  See the
  71.  *    documentation in Mem_PrintStatsSubr for the calling sequence to
  72.  *    memPrintProc.
  73.  *
  74.  * ----------------------------------------------------------------------------
  75.  */
  76.  
  77. ENTRY void
  78. Mem_PrintInUse()
  79. {
  80.     register Address ptr;
  81.  
  82.     LOCK_MONITOR;
  83.  
  84.     if (!memInitialized) {
  85.     (*memPrintProc)(memPrintData, "Allocator not initialized yet.\n");
  86.     return;
  87.     }
  88.  
  89.     (*memPrintProc)(memPrintData, "Large objects still in use:\n");
  90.     (*memPrintProc)(memPrintData, "    Location   Orig. Size   Alloc.PC\n");
  91.  
  92.     for (ptr = memFirst; ptr != memLast; ptr += SIZE(GET_ADMIN(ptr))) {
  93.  
  94.     if (!IS_DUMMY(GET_ADMIN(ptr)) && IS_IN_USE(GET_ADMIN(ptr))) {
  95. #ifdef MEM_TRACE
  96.         (*memPrintProc)(memPrintData,"%#12x %10d %#12x\n",
  97.             ptr, GET_ORIG_SIZE(ptr), GET_PC(ptr));
  98. #else
  99.         (*memPrintProc)(memPrintData,"%#12x %10d %12s\n", ptr,
  100.             SIZE(GET_ADMIN(ptr)) - sizeof(AdminInfo), "??");
  101. #endif MEM_TRACE
  102.  
  103.     }
  104.     }
  105.     UNLOCK_MONITOR;
  106. }
  107. @
  108.  
  109.  
  110. 1.2.1.1
  111. log
  112. @Initial branch for Sprite server.
  113. @
  114. text
  115. @d18 1
  116. a18 1
  117. static char rcsid[] = "$Header: /sprite/src/lib/c/stdlib/RCS/Mem_PrintInUse.c,v 1.2 89/06/15 22:36:49 douglis Exp $ SPRITE (Berkeley)";
  118. @
  119.  
  120.  
  121. 1.1
  122. log
  123. @Initial revision
  124. @
  125. text
  126. @d18 1
  127. a18 1
  128. static char rcsid[] = "$Header: proto.c,v 1.2 88/03/11 08:39:08 ouster Exp $ SPRITE (Berkeley)";
  129. d63 1
  130. a63 1
  131.         (*memPrintProc)(memPrintData,"%12#x %10d %12#x\n",
  132. d66 1
  133. a66 1
  134.         (*memPrintProc)(memPrintData,"%12#x %10d %12s\n", ptr,
  135. @
  136.